package com.unknownman.block.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lianziyou.chain.common.api.CommonPage;
import com.lianziyou.chain.common.api.CommonResult;
import com.unknownman.block.constants.ChainContractConstants;
import com.unknownman.block.entity.TContractConfig;
import org.cloud.exception.BusinessException;

import java.util.List;


/**
* <p>
    * NFT合约配置 服务类
    * </p>
*
* @author xhy
* @since 2021-10-18
*/
public interface TContractConfigService extends IService<TContractConfig> {
    /**
    * 查询NFT合约配置分页数据
    *
    * @param page      页码
    * @param limit 每页条数
    * @return CommonResult<TContractConfig>
    */
    CommonPage<TContractConfig> findListByPage(Integer page, Integer limit, String orderBy, QueryWrapper<TContractConfig> queryWrapper);

    /**
     * 根据状态获取合约配置
     * @param contractStatus
     * @return
     */
    public List<TContractConfig> getListByStatus(ChainContractConstants.ContractStatusConstants contractStatus);

    /**
     * 根据链配置id获取合约列表
     * @param chiaConfigId
     * @return
     */
    public List<TContractConfig> getListByChainConfigId(Long chiaConfigId, ChainContractConstants.ContractStatusConstants contractStatus);

    CommonResult updateContract(TContractConfig config) throws BusinessException;

    CommonResult addContract(TContractConfig config) throws BusinessException;

    CommonResult updateStatus(Long contractConfigId, Integer status) throws BusinessException;

    TContractConfig getBySymbol(String symbol);
}
